import Api from "../../request/api"
export default {
    namespaced: true,
    state: {
        specslist: [],
        specstotal:0
    },
    mutations: {
        initSpecsList(state, payload) {
            state.specslist = payload
        },
        initSpecsTotal(state,payload){
            state.specstotal = payload
        }
    },
    actions: {
        getspecslist({commit},payload) {
            Api.specslist(payload).then(res => {
                if (res.code == 200) {
                    commit("initSpecsList", res.list)
                }
            })
        },
        // 总页数
        getspecstotal({commit}){
            Api.specscount().then(res=>{
                if (res.code == 200) {
                    commit("initSpecsTotal", res.list[0].total)
                }
            })
        }
    },
    getters: {},

}